import React from 'react'
import {connect} from 'react-redux'

// components
import GoBackLayout from "../../layouts/GoBackLayout/GoBackLayout"

// antd-mobile
import {Button} from 'antd-mobile'

const ApplyStarContainer = (props) => {
    // states
    const {history,} = props
    // dispatch
    const {doApplyStar,} = props

    // functions
    const applyStar = () => {
        const uid = localStorage.getItem('userid')
        doApplyStar({uid,})
    }

    return (
        <GoBackLayout
            history={history}
            title='申请成为主播'
        >
            <Button
                onClick={applyStar}
            >申请成为主播</Button>
        </GoBackLayout>
    )
}

const mapStateToProps = (state) => ({})
const mapDispatchToProps = ({user: {doApplyStar,},}) => ({
    doApplyStar: (payload) => doApplyStar(payload),
})

export default connect(mapStateToProps,mapDispatchToProps)(ApplyStarContainer)
